Skip to main content
Glama

get_companies_by_sector

Retrieve Spanish stock exchange companies filtered by specific sectors like Banking, Technology, or Energy to analyze market relationships and sector composition.

Instructions

Get companies filtered by sector

Input Schema

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

Implementation Reference

  • Handler logic in the MCP tool dispatcher switch statement that extracts the sector argument and delegates execution to the DatabaseManager's getCompaniesBySector method.
    case 'get_companies_by_sector':
      result = await this.db.getCompaniesBySector((args as any)?.sector);
      break;
  • Tool schema definition in the ListTools response, specifying name, description, and input schema that requires a 'sector' string parameter.
    {
      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'],
      },
    },
  • DatabaseManager method that implements the core filtering logic: fetches all companies via API and returns those whose sector name contains the provided sector string (case-insensitive partial match).
    async getCompaniesBySector(sector: string): Promise<any[]> {
      const companies = await this.getAllCompanies();
      return companies.filter(company => 
        company.sector && company.sector.toLowerCase().includes(sector.toLowerCase())
      );
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure but only states the basic filtering action. It doesn't mention whether this is a read-only operation, what the return format looks like (e.g., list of companies with basic details), potential rate limits, or any authentication requirements. For a tool with zero annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that communicates the core functionality without any wasted words. It's appropriately sized for a simple filtering tool and gets straight to the point.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what information is returned about companies (e.g., names, symbols, financial data) or how results are structured. For a tool that presumably returns multiple company records, more context about the output would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 100% description coverage, with the 'sector' parameter well-documented in the schema itself (including examples like 'Banking, Technology, Energy'). The description adds no additional parameter semantics beyond what's already in the schema, so it meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('companies') with a specific filter ('by sector'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get_all_companies' or 'get_top_shareholders_by_sector' beyond the basic filtering aspect.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternatives like 'get_all_companies' (for unfiltered lists) or 'compare_companies' (for detailed comparisons). The description implies usage for sector-based filtering but offers no context about prerequisites, limitations, or when other tools might be more appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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