Skip to main content
Glama
MCP-100

Stock Market MCP Server

by MCP-100

get_financial_statement

Retrieve company financial statements (income, balance, cashflow) by specifying the stock ticker symbol and statement type using this tool on the Stock Market MCP Server.

Instructions

Get financial statements for a company

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statementYesType of financial statement
symbolYesStock ticker symbol

Implementation Reference

  • The handler function that validates input, maps statement type to Alpha Vantage API function, fetches the data, and returns it as JSON.
    private async handleGetFinancialStatement(args: { statement: 'income' | 'balance' | 'cashflow'; symbol: string }) { if (!args || typeof args !== 'object' || !args.statement || !['income', 'balance', 'cashflow'].includes(args.statement)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid statement parameter'); } if (!args.symbol || typeof args.symbol !== 'string') { throw new McpError(ErrorCode.InvalidParams, 'Invalid symbol parameter'); } const functionMap = { income: 'INCOME_STATEMENT', balance: 'BALANCE_SHEET', cashflow: 'CASH_FLOW' }; const response = await this.axiosInstance.get('', { params: { function: functionMap[args.statement], symbol: args.symbol } }); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }] }; }
  • Input schema defining the required 'symbol' and 'statement' parameters with types and descriptions.
    inputSchema: { type: 'object', properties: { symbol: { type: 'string', description: 'Stock ticker symbol' }, statement: { type: 'string', enum: ['income', 'balance', 'cashflow'], description: 'Type of financial statement' } }, required: ['symbol', 'statement'] }
  • src/index.ts:75-93 (registration)
    Tool registration in the ListTools response, including name, description, and input schema.
    { name: 'get_financial_statement', description: 'Get financial statements for a company', inputSchema: { type: 'object', properties: { symbol: { type: 'string', description: 'Stock ticker symbol' }, statement: { type: 'string', enum: ['income', 'balance', 'cashflow'], description: 'Type of financial statement' } }, required: ['symbol', 'statement'] } },
  • src/index.ts:118-124 (registration)
    Switch case in CallToolRequest handler that validates arguments and delegates to the handler function.
    case 'get_financial_statement': { if (!request.params.arguments || typeof request.params.arguments !== 'object') { throw new McpError(ErrorCode.InvalidParams, 'Invalid arguments'); } const args = request.params.arguments as { statement: 'income' | 'balance' | 'cashflow'; symbol: string }; return await this.handleGetFinancialStatement(args); }

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/MCP-100/stock-market-server'

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