Skip to main content
Glama

get_all_companies

Retrieve current stock prices and key financial metrics for all companies listed in Spain's IBEX 35 index to analyze market relationships.

Instructions

Get all IBEX 35 companies with current prices and key metrics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for the 'get_all_companies' tool in the CallToolRequestSchema switch statement. Delegates execution to DatabaseManager.getAllCompanies().
    case 'get_all_companies':
      result = await this.db.getAllCompanies();
      break;
  • Tool schema definition including name, description, and empty input schema (no parameters required).
      name: 'get_all_companies',
      description: 'Get all IBEX 35 companies with current prices and key metrics',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • src/index.ts:49-568 (registration)
    Registration of the 'get_all_companies' tool within the ListToolsRequestSchema response array.
        tools: [
          // Company queries
          {
            name: 'get_all_companies',
            description: 'Get all IBEX 35 companies with current prices and key metrics',
            inputSchema: {
              type: 'object',
              properties: {},
            },
          },
          {
            name: 'get_company_by_symbol',
            description: 'Get detailed information for a specific company by its stock symbol',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: {
                  type: 'string',
                  description: 'Stock symbol (e.g., SAN, TEF, IBE)',
                },
              },
              required: ['symbol'],
            },
          },
          {
            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'],
            },
          },
          {
            name: 'get_companies_with_pe_ratio',
            description: 'Get companies filtered by P/E ratio range',
            inputSchema: {
              type: 'object',
              properties: {
                minPE: {
                  type: 'number',
                  description: 'Minimum P/E ratio',
                },
                maxPE: {
                  type: 'number',
                  description: 'Maximum P/E ratio',
                },
              },
            },
          },
          
          // Director and governance queries
          {
            name: 'get_company_directors',
            description: 'Get board directors for a specific company',
            inputSchema: {
              type: 'object',
              properties: {
                companyId: {
                  type: 'string',
                  description: 'Company ID or use get_company_by_symbol first to get ID',
                },
              },
              required: ['companyId'],
            },
          },
          {
            name: 'get_board_interlocks',
            description: 'Find directors who serve on multiple IBEX 35 company boards',
            inputSchema: {
              type: 'object',
              properties: {},
            },
          },
          {
            name: 'get_directors_by_name',
            description: 'Search for directors by name across all companies',
            inputSchema: {
              type: 'object',
              properties: {
                name: {
                  type: 'string',
                  description: 'Director name or partial match',
                },
              },
              required: ['name'],
            },
          },
    
          // Shareholder queries
          {
            name: 'get_company_shareholders',
            description: 'Get shareholders for a specific company',
            inputSchema: {
              type: 'object',
              properties: {
                companyId: {
                  type: 'string',
                  description: 'Company ID',
                },
              },
              required: ['companyId'],
            },
          },
          {
            name: 'get_shareholder_overlap',
            description: 'Find shareholders who own stakes in multiple IBEX 35 companies',
            inputSchema: {
              type: 'object',
              properties: {},
            },
          },
          {
            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'],
            },
          },
    
          // Market data queries
          {
            name: 'get_historical_prices',
            description: 'Get historical price data for a company',
            inputSchema: {
              type: 'object',
              properties: {
                companyId: {
                  type: 'string',
                  description: 'Company ID',
                },
                days: {
                  type: 'number',
                  description: 'Number of days of historical data',
                  default: 30,
                },
              },
              required: ['companyId'],
            },
          },
          {
            name: 'get_top_performers',
            description: 'Get top performing stocks over a specified period',
            inputSchema: {
              type: 'object',
              properties: {
                days: {
                  type: 'number',
                  description: 'Period in days',
                  default: 7,
                },
                limit: {
                  type: 'number',
                  description: 'Maximum number of results',
                  default: 10,
                },
              },
            },
          },
    
          // News and sentiment
          {
            name: 'get_recent_news',
            description: 'Get recent news articles, optionally filtered by company',
            inputSchema: {
              type: 'object',
              properties: {
                companyId: {
                  type: 'string',
                  description: 'Optional: Company ID to filter by',
                },
                limit: {
                  type: 'number',
                  description: 'Maximum number of articles',
                  default: 20,
                },
              },
            },
          },
          {
            name: 'get_news_by_sentiment',
            description: 'Get news articles filtered by sentiment',
            inputSchema: {
              type: 'object',
              properties: {
                sentiment: {
                  type: 'string',
                  enum: ['positive', 'negative', 'neutral'],
                  description: 'News sentiment',
                },
                limit: {
                  type: 'number',
                  description: 'Maximum number of articles',
                  default: 20,
                },
              },
              required: ['sentiment'],
            },
          },
    
          // Lobbying and transparency
          {
            name: 'get_lobbying_meetings',
            description: 'Get EU lobbying meetings, optionally filtered by company',
            inputSchema: {
              type: 'object',
              properties: {
                companyId: {
                  type: 'string',
                  description: 'Optional: Company ID to filter by',
                },
                limit: {
                  type: 'number',
                  description: 'Maximum number of meetings',
                  default: 20,
                },
              },
            },
          },
          {
            name: 'get_most_active_lobbyists',
            description: 'Get organizations with the most EU lobbying meetings',
            inputSchema: {
              type: 'object',
              properties: {
                limit: {
                  type: 'number',
                  description: 'Maximum number of results',
                  default: 10,
                },
              },
            },
          },
    
          // ESG data
          {
            name: 'get_esg_scores',
            description: 'Get ESG (Environmental, Social, Governance) scores',
            inputSchema: {
              type: 'object',
              properties: {
                companyId: {
                  type: 'string',
                  description: 'Optional: Company ID to filter by',
                },
              },
            },
          },
    
          // Weekly reports
          {
            name: 'get_weekly_reports',
            description: 'Get generated weekly reports and analysis',
            inputSchema: {
              type: 'object',
              properties: {
                reportType: {
                  type: 'string',
                  enum: ['market_overview', 'sector_analysis', 'governance_highlights', 'full_report'],
                  description: 'Type of report to filter by',
                },
                limit: {
                  type: 'number',
                  description: 'Maximum number of reports',
                  default: 10,
                },
              },
            },
          },
    
          // Advanced Analytics
          {
            name: 'get_network_analysis',
            description: 'Get comprehensive network analysis of board interlocks and shareholder relationships',
            inputSchema: {
              type: 'object',
              properties: {},
            },
          },
          {
            name: 'get_sector_correlation_analysis',
            description: 'Analyze sector performance correlations and market trends',
            inputSchema: {
              type: 'object',
              properties: {
                days: {
                  type: 'number',
                  description: 'Number of days to analyze',
                  default: 30,
                },
              },
            },
          },
    
          // Enhanced query processing and analysis
          {
            name: 'analyze_natural_query',
            description: 'Process and execute complex natural language queries about companies, financials, governance, or markets',
            inputSchema: {
              type: 'object',
              properties: {
                query: {
                  type: 'string',
                  description: 'Natural language query (e.g., "Which banking stocks have grown most in the last month?", "Show me companies with high governance risk", "Compare energy sector performance")',
                },
                context: {
                  type: 'string',
                  description: 'Optional context or previous query results to build upon',
                },
              },
              required: ['query'],
            },
          },
          {
            name: 'compare_companies',
            description: 'Compare multiple companies across various metrics (financial, governance, market performance)',
            inputSchema: {
              type: 'object',
              properties: {
                companies: {
                  type: 'array',
                  items: {
                    type: 'string',
                  },
                  description: 'List of company symbols or names to compare',
                },
                metrics: {
                  type: 'array',
                  items: {
                    type: 'string',
                    enum: ['financial', 'governance', 'market_performance', 'sector_position', 'risk_profile', 'all'],
                  },
                  description: 'Metrics to compare (defaults to all if not specified)',
                  default: ['all'],
                },
              },
              required: ['companies'],
            },
          },
          {
            name: 'analyze_trends',
            description: 'Analyze trends in stock prices, market performance, or sector movements over time',
            inputSchema: {
              type: 'object',
              properties: {
                analysis_type: {
                  type: 'string',
                  enum: ['company_trend', 'sector_trend', 'market_trend', 'correlation_analysis'],
                  description: 'Type of trend analysis to perform',
                },
                target: {
                  type: 'string',
                  description: 'Company symbol, sector name, or "market" for overall analysis',
                },
                period: {
                  type: 'number',
                  description: 'Number of days to analyze',
                  default: 30,
                },
                include_forecast: {
                  type: 'boolean',
                  description: 'Whether to include simple trend forecast',
                  default: false,
                },
              },
              required: ['analysis_type', 'target'],
            },
          },
          {
            name: 'assess_investment_risk',
            description: 'Comprehensive risk assessment for companies or sectors including market, governance, and operational risks',
            inputSchema: {
              type: 'object',
              properties: {
                target: {
                  type: 'string',
                  description: 'Company symbol, sector name, or portfolio of companies',
                },
                risk_types: {
                  type: 'array',
                  items: {
                    type: 'string',
                    enum: ['market_risk', 'governance_risk', 'sector_risk', 'liquidity_risk', 'concentration_risk', 'all'],
                  },
                  description: 'Types of risk to assess',
                  default: ['all'],
                },
              },
              required: ['target'],
            },
          },
          {
            name: 'generate_analyst_report',
            description: 'Generate a comprehensive analyst report for a company, sector, or market theme',
            inputSchema: {
              type: 'object',
              properties: {
                subject: {
                  type: 'string',
                  description: 'Company symbol, sector name, or theme to analyze',
                },
                report_type: {
                  type: 'string',
                  enum: ['company_deep_dive', 'sector_overview', 'governance_analysis', 'market_opportunity', 'risk_assessment'],
                  description: 'Type of report to generate',
                },
                include_charts: {
                  type: 'boolean',
                  description: 'Whether to include data visualizations (text-based)',
                  default: true,
                },
              },
              required: ['subject', 'report_type'],
            },
          },
          {
            name: 'screen_opportunities',
            description: 'Screen for investment opportunities based on specific criteria (value, growth, dividend, ESG, etc.)',
            inputSchema: {
              type: 'object',
              properties: {
                screening_criteria: {
                  type: 'object',
                  properties: {
                    pe_ratio_max: {
                      type: 'number',
                      description: 'Maximum P/E ratio',
                    },
                    pe_ratio_min: {
                      type: 'number',
                      description: 'Minimum P/E ratio',
                    },
                    market_cap_min: {
                      type: 'number',
                      description: 'Minimum market capitalization',
                    },
                    market_cap_max: {
                      type: 'number',
                      description: 'Maximum market capitalization',
                    },
                    sectors: {
                      type: 'array',
                      items: {
                        type: 'string',
                      },
                      description: 'Specific sectors to include',
                    },
                    exclude_sectors: {
                      type: 'array',
                      items: {
                        type: 'string',
                      },
                      description: 'Sectors to exclude',
                    },
                    performance_period: {
                      type: 'number',
                      description: 'Days to look back for performance metrics',
                      default: 30,
                    },
                    governance_quality: {
                      type: 'string',
                      enum: ['high', 'medium', 'low', 'any'],
                      description: 'Required governance quality level',
                      default: 'any',
                    },
                  },
                },
                limit: {
                  type: 'number',
                  description: 'Maximum number of opportunities to return',
                  default: 10,
                },
              },
              required: ['screening_criteria'],
            },
          },
    
          // Custom queries
          {
            name: 'execute_custom_query',
            description: 'Execute a custom SQL query on the database (SELECT only)',
            inputSchema: {
              type: 'object',
              properties: {
                sql: {
                  type: 'string',
                  description: 'SQL SELECT query to execute',
                },
                params: {
                  type: 'array',
                  items: {
                    type: 'string',
                  },
                  description: 'Optional parameters for the query',
                  default: [],
                },
              },
              required: ['sql'],
            },
          },
        ] as Tool[],
      };
    });
  • Core implementation of getAllCompanies() in DatabaseManager, fetches company data from '/api/companies' endpoint.
    async getAllCompanies(): Promise<any[]> {
      const data = await this.fetchAPI('/api/companies');
      return data.data || [];
    }
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It states what data is retrieved but doesn't cover aspects like rate limits, data freshness, authentication needs, or potential errors. This is a significant gap for a data-fetching tool.

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 front-loads the key information (verb, resource, scope, data) with zero waste. Every word earns its place, making it highly concise and well-structured.

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

Completeness3/5

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

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is adequate but has clear gaps. It covers the purpose and data scope but lacks behavioral details like data format or limitations, making it minimally viable for a read-only tool.

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

Parameters4/5

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

The tool has 0 parameters with 100% schema description coverage, so the schema fully documents the absence of inputs. The description adds value by specifying the scope (IBEX 35 companies) and data returned (current prices and key metrics), which compensates appropriately.

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 the resource 'IBEX 35 companies', specifying the scope and data returned (current prices and key metrics). It distinguishes from siblings like get_companies_by_sector or get_company_by_symbol by focusing on all companies in the index, though it doesn't explicitly contrast them.

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 on when to use this tool versus alternatives such as get_companies_by_sector or get_top_performers. The description implies usage for retrieving all companies in the IBEX 35, but lacks explicit context or exclusions.

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