get_insider_trading
Retrieve recent insider trading transactions for a specific stock to monitor corporate insider activity and identify potential market signals.
Instructions
Get recent insider trading activity for a stock
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | Stock ticker symbol | |
| limit | No | Number of transactions to return (default: 100) |
Implementation Reference
- src/tools/analysis.ts:94-111 (handler)The handler for 'get_insider_trading' fetches insider trading data from the FMP API.
server.registerTool( 'get_insider_trading', { description: 'Get recent insider trading activity for a stock', inputSchema: InsiderTradingSchema, }, async (args: z.infer<typeof InsiderTradingSchema>) => { try { const limit = args.limit || 100; const data = await fetchFMP<InsiderTrading[]>( `/insider-trading/search?symbol=${args.symbol.toUpperCase()}&limit=${limit}` ); return jsonResponse(data); } catch (error) { return errorResponse(error); } } ); - src/tools/analysis.ts:24-27 (schema)Zod schema for validating 'get_insider_trading' inputs.
const InsiderTradingSchema = z.object({ symbol: SymbolSchema.describe('Stock ticker symbol'), limit: LimitSchema.describe('Number of transactions to return (default: 100)'), }); - src/tools/analysis.ts:37-132 (registration)Tool registration within the 'registerAnalysisTools' function.
export function registerAnalysisTools(server: any) { // Analyst Estimates server.registerTool( 'get_analyst_estimates', { description: 'Get analyst financial estimates for a stock (revenue, EPS forecasts)', inputSchema: AnalystEstimatesSchema, }, async (args: z.infer<typeof AnalystEstimatesSchema>) => { try { const period = args.period || 'annual'; const limit = args.limit || 10; const data = await fetchFMP<AnalystEstimate[]>( `/analyst-estimates?symbol=${args.symbol.toUpperCase()}&period=${period}&limit=${limit}` ); return jsonResponse(data); } catch (error) { return errorResponse(error); } } ); // Price Target server.registerTool( 'get_price_target', { description: 'Get analyst price target summary for a stock', inputSchema: SymbolOnlySchema, }, async (args: z.infer<typeof SymbolOnlySchema>) => { try { const data = await fetchFMP<PriceTarget[]>(`/price-target-summary?symbol=${args.symbol.toUpperCase()}`); return jsonResponse(data); } catch (error) { return errorResponse(error); } } ); // Analyst Ratings server.registerTool( 'get_analyst_ratings', { description: 'Get analyst ratings and upgrades/downgrades for a stock', inputSchema: SymbolOnlySchema, }, async (args: z.infer<typeof SymbolOnlySchema>) => { try { const data = await fetchFMP<AnalystRating[]>(`/grades?symbol=${args.symbol.toUpperCase()}`); return jsonResponse(data); } catch (error) { return errorResponse(error); } } ); // Insider Trading server.registerTool( 'get_insider_trading', { description: 'Get recent insider trading activity for a stock', inputSchema: InsiderTradingSchema, }, async (args: z.infer<typeof InsiderTradingSchema>) => { try { const limit = args.limit || 100; const data = await fetchFMP<InsiderTrading[]>( `/insider-trading/search?symbol=${args.symbol.toUpperCase()}&limit=${limit}` ); return jsonResponse(data); } catch (error) { return errorResponse(error); } } ); // Institutional Holders server.registerTool( 'get_institutional_holders', { description: 'Get institutional ownership (13F filings) for a stock', inputSchema: InstitutionalHoldersSchema, }, async (args: z.infer<typeof InstitutionalHoldersSchema>) => { try { const limit = args.limit || 100; const data = await fetchFMP<InstitutionalHolder[]>( `/institutional-ownership/latest?symbol=${args.symbol.toUpperCase()}&limit=${limit}` ); return jsonResponse(data); } catch (error) { return errorResponse(error); } } ); }