Skip to main content
Glama

MCP Avantage

by MissionSquad

alphaIntelligence_insiderTransactions

Retrieve aggregated insider trading data for any stock symbol, enabling analysis of executive and institutional transactions to inform investment decisions.

Instructions

Fetches aggregated insider trading information for a given symbol.

Input Schema

NameRequiredDescriptionDefault
symbolYesThe stock symbol (e.g., "AAPL").

Input Schema (JSON Schema)

{ "additionalProperties": false, "description": "Parameters for fetching insider trading information.", "properties": { "symbol": { "description": "The stock symbol (e.g., \"AAPL\").", "type": "string" } }, "required": [ "symbol" ], "type": "object" }

Implementation Reference

  • src/index.ts:155-170 (registration)
    Tool registration including name, description, schema reference, and execute handler that delegates to executeAvantageTool calling the Alpha Vantage insiderTransactions method.
    server.addTool({ name: "alphaIntelligence_insiderTransactions", description: "Fetches aggregated insider trading information for a given symbol.", parameters: schemas.InsiderTransactionsParamsSchema, execute: ( args, context // Let type be inferred ) => executeAvantageTool( "alphaIntelligence_insiderTransactions", args, context, (av, params) => av.alphaIntelligence.insiderTransactions(params.symbol) ), });
  • Zod schema defining the input parameters for the tool: a required 'symbol' string.
    export const InsiderTransactionsParamsSchema = z.object({ symbol: z.string().describe('The stock symbol (e.g., "AAPL").'), }).describe('Parameters for fetching insider trading information.')
  • Shared helper function used by all tools to execute Alpha Vantage API calls, handling client management, caching, and error handling. Specific callback for this tool invokes av.alphaIntelligence.insiderTransactions.
    async function executeAvantageTool<TArgs, TResult>( toolName: string, args: TArgs, context: Context<Record<string, unknown> | undefined>, // Use the imported Context type directly avantageMethod: ( av: AVantage, args: TArgs ) => Promise<{ error?: boolean; reason?: string; data?: TResult }> ): Promise<string> { logger.info(`Executing '${toolName}' tool for request ID: ${context}`); logger.debug(`Args for ${toolName}: ${JSON.stringify(args)}`); // --- Authentication & Resource Management --- // Access extraArgs safely - it might be null or undefined const extraArgsApiKey = context.extraArgs?.apiKey as string | undefined; const apiKey = extraArgsApiKey || config.apiKey; if (!apiKey) { logger.error(`'${toolName}' failed: Alpha Vantage API key missing.`); throw new UserError(apiKeyErrorMessage); } logger.debug( `Using AV API key (source: ${extraArgsApiKey ? "extraArgs" : "environment"}) for ${toolName}`

Other Tools

Related 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/MissionSquad/mcp-avantage'

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