Skip to main content
Glama

get_companies_by_sector

Filter and retrieve companies from the Spanish stock exchange based on specific industry sectors such as Banking, Technology, or Energy.

Instructions

Get companies filtered by sector

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sectorYesSector name or partial match (e.g., Banking, Technology, Energy)

Implementation Reference

  • Core handler implementing the tool logic: fetches all companies and filters those whose sector name contains the provided sector string (case-insensitive).
    async getCompaniesBySector(sector: string): Promise<any[]> { const companies = await this.getAllCompanies(); return companies.filter(company => company.sector && company.sector.toLowerCase().includes(sector.toLowerCase()) ); }
  • Input schema definition for the get_companies_by_sector tool, specifying a required 'sector' string parameter.
    inputSchema: { type: 'object', properties: { sector: { type: 'string', description: 'Sector name or partial match (e.g., Banking, Technology, Energy)', }, }, required: ['sector'], },
  • src/index.ts:73-86 (registration)
    Tool registration metadata including name, description, and input schema, added to the MCP server's tools list.
    { name: 'get_companies_by_sector', description: 'Get companies filtered by sector', inputSchema: { type: 'object', properties: { sector: { type: 'string', description: 'Sector name or partial match (e.g., Banking, Technology, Energy)', }, }, required: ['sector'], }, },
  • MCP request handler dispatch case that invokes the database method with the tool argument.
    case 'get_companies_by_sector': result = await this.db.getCompaniesBySector((args as any)?.sector); break;

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