get_company_shareholders
Retrieve shareholder information for companies in the Spanish stock exchange to analyze ownership structures and relationships.
Instructions
Get shareholders for a specific company
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| companyId | Yes | Company ID |
Implementation Reference
- src/database.ts:138-151 (handler)Core implementation of get_company_shareholders: fetches shareholder positions from API, looks up company symbol by ID, and filters shareholders for that company.async getCompanyShareholders(companyId: string): Promise<any[]> { const data = await this.fetchAPI('/api/shareholder-positions'); const shareholders = data.shareholderPositions || data.positions || []; // Find company by ID first to get symbol const companies = await this.getAllCompanies(); const company = companies.find(c => c.id === companyId); if (!company) return []; return shareholders.filter(position => position.company_symbol === company.symbol || position.ticker === company.symbol ); }
- src/index.ts:144-157 (registration)Tool registration in the list of tools returned by ListToolsRequestHandler, including name, description, and input schema.{ name: 'get_company_shareholders', description: 'Get shareholders for a specific company', inputSchema: { type: 'object', properties: { companyId: { type: 'string', description: 'Company ID', }, }, required: ['companyId'], }, },
- src/index.ts:605-607 (handler)Dispatch handler in CallToolRequestSchema that extracts companyId from arguments and calls the database method.case 'get_company_shareholders': result = await this.db.getCompanyShareholders((args as any)?.companyId); break;
- src/analytics.ts:323-323 (helper)Usage of getCompanyShareholders as a helper in company comparison analysis.const shareholders = await this.db.getCompanyShareholders(company.id);