get_company_profile
Retrieve business description, industry classification, and company background for US-listed companies by specifying exchange and ticker symbol.
Instructions
Get business description, industry, and background for a US-listed company by ticker.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| exchange | Yes | US exchange: amex, nasdaq, nyse | |
| ticker | Yes | Stock ticker symbol (case-sensitive) |
Implementation Reference
- src/core.ts:778-803 (registration)Registration of the 'get_company_profile' tool, including input schema and inline handler functionserver.registerTool( "get_company_profile", { title: "Company profile (US)", description: "Get business description, industry, and background for a US-listed company by ticker.", inputSchema: { exchange: z .enum(US_EXCHANGES) .describe("US exchange: amex, nasdaq, nyse"), ticker: z.string().describe("Stock ticker symbol (case-sensitive)"), }, }, async ({ exchange, ticker }: { exchange: USExchange; ticker: string }) => { try { const securityInfo = await fetchSecurityInfo(exchange, ticker); return createResponse({ info: INFO, charts: createCharts(exchange), ...securityInfo, }); } catch (error) { return createErrorResponse(error); } }, );
- src/core.ts:791-802 (handler)Inline handler that fetches company profile data via fetchSecurityInfo and formats the responseasync ({ exchange, ticker }: { exchange: USExchange; ticker: string }) => { try { const securityInfo = await fetchSecurityInfo(exchange, ticker); return createResponse({ info: INFO, charts: createCharts(exchange), ...securityInfo, }); } catch (error) { return createErrorResponse(error); } },
- src/core.ts:237-251 (helper)Helper function that fetches the detailed company profile JSON data from the GitHub repository based on exchange and tickerasync function fetchSecurityInfo( exchange: USExchange, ticker: string, ): Promise<Record<string, any>> { const firstLetter = ticker.charAt(0).toUpperCase(); const url = `${DATA_BASE_URL}/data-us/refs/heads/main/securities/${exchange}/${firstLetter}/${ticker}.json`; const response = await fetch(url); if (response.status === 404) { throw new Error(`Security ${ticker} not found on ${exchange}`); } const data = (await response.json()) as any; return data; }
- src/core.ts:30-30 (schema)Type definition for US exchanges used in the tool's input schemaconst US_EXCHANGES = ["amex", "nasdaq", "nyse"] as const;