Skip to main content
Glama
jackdark425

Financial Modeling Prep (FMP) MCP Server

by jackdark425

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
NameRequiredDescriptionDefault
symbolYesStock ticker symbol
limitNoNumber of transactions to return (default: 100)

Implementation Reference

  • 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);
        }
      }
    );
  • 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)'),
    });
  • 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);
          }
        }
      );
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool gets 'recent' activity, implying time-bound data, but doesn't specify what 'recent' means (e.g., last 30 days), whether it's read-only, requires authentication, has rate limits, or what the output format is. For a data retrieval tool with zero annotation coverage, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It's front-loaded with the core purpose, making it easy to parse. Every part of the sentence contributes directly to understanding the tool's function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (financial data retrieval), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like data recency, error handling, or output structure, leaving gaps for an AI agent to use it effectively. The conciseness comes at the cost of necessary detail.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds minimal meaning beyond the input schema, which has 100% coverage with clear descriptions for 'symbol' and 'limit'. It implies the tool filters by stock symbol and returns a limited set, but doesn't provide additional context like symbol format examples or limit constraints. With high schema coverage, the baseline is 3, and the description doesn't significantly enhance parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get recent insider trading activity for a stock.' It specifies the verb ('Get') and resource ('insider trading activity'), and distinguishes it from siblings like get_analyst_ratings or get_balance_sheet by focusing on insider trading. However, it doesn't explicitly differentiate from all siblings (e.g., it's clear but not exhaustive in sibling comparison).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context (e.g., for investment analysis), or exclusions (e.g., not for real-time data). With many sibling tools for financial data, this lack of usage context is a significant gap.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jackdark425/aigroup-fmp-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server