Skip to main content
Glama

get_top_shareholders_by_sector

Identify key investors in a specific sector of the Spanish stock exchange by retrieving top shareholders for sector analysis and investment research.

Instructions

Get top shareholders in a specific sector

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sectorYesSector name
limitNoMaximum number of results

Implementation Reference

  • Core handler function that implements the tool logic: fetches companies in the sector, retrieves all shareholder positions, filters to sector companies, sorts by ownership percentage descending, and limits results.
    async getTopShareholdersBySector(sector: string, limit: number = 10): Promise<any[]> { const companies = await this.getCompaniesBySector(sector); const data = await this.fetchAPI('/api/shareholder-positions'); const shareholders = data.shareholderPositions || data.positions || []; const sectorSymbols = companies.map(c => c.symbol); const sectorShareholders = shareholders.filter(position => sectorSymbols.includes(position.company_symbol || position.ticker) ); return sectorShareholders .sort((a, b) => (b.percentage || 0) - (a.percentage || 0)) .slice(0, limit); }
  • src/index.ts:166-184 (registration)
    Tool registration in the listTools response, including name, description, and input schema.
    { name: 'get_top_shareholders_by_sector', description: 'Get top shareholders in a specific sector', inputSchema: { type: 'object', properties: { sector: { type: 'string', description: 'Sector name', }, limit: { type: 'number', description: 'Maximum number of results', default: 10, }, }, required: ['sector'], }, },
  • Dispatch handler in the CallToolRequestSchema switch statement that invokes the database method with parsed arguments.
    case 'get_top_shareholders_by_sector': result = await this.db.getTopShareholdersBySector((args as any)?.sector, (args as any)?.limit || 10); break;
  • Input schema defining parameters: sector (required string), limit (optional number, default 10).
    inputSchema: { type: 'object', properties: { sector: { type: 'string', description: 'Sector name', }, limit: { type: 'number', description: 'Maximum number of results', default: 10, }, }, required: ['sector'],

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/anbrme/ibex35-mcp-server'

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