Skip to main content
Glama

get_company_profile

Retrieve structured LinkedIn company profile data including optional employee information for business intelligence and research purposes.

Instructions

Get a specific company's LinkedIn profile.

Args: company_name (str): LinkedIn company name (e.g., "docker", "anthropic", "microsoft") get_employees (bool): Whether to scrape the company's employees (slower)

Returns: Dict[str, Any]: Structured data from the company's profile

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
company_nameYes
get_employeesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function for get_company_profile tool. Scrapes LinkedIn company page using linkedin_scraper.Company, optionally fetches employees, extracts structured data (name, about, website, etc., showcase_pages, affiliated_companies), handles errors with handle_tool_error.
    @mcp.tool()
    async def get_company_profile(
        company_name: str, get_employees: bool = False
    ) -> Dict[str, Any]:
        """
        Get a specific company's LinkedIn profile.
    
        Args:
            company_name (str): LinkedIn company name (e.g., "docker", "anthropic", "microsoft")
            get_employees (bool): Whether to scrape the company's employees (slower)
    
        Returns:
            Dict[str, Any]: Structured data from the company's profile
        """
        try:
            # Construct clean LinkedIn URL from company name
            linkedin_url = f"https://www.linkedin.com/company/{company_name}/"
    
            driver = safe_get_driver()
    
            logger.info(f"Scraping company: {linkedin_url}")
            if get_employees:
                logger.info("Fetching employees may take a while...")
    
            company = Company(
                linkedin_url,
                driver=driver,
                get_employees=get_employees,
                close_on_complete=False,
            )
    
            # Convert showcase pages to structured dictionaries
            showcase_pages: List[Dict[str, Any]] = [
                {
                    "name": page.name,
                    "linkedin_url": page.linkedin_url,
                    "followers": page.followers,
                }
                for page in company.showcase_pages
            ]
    
            # Convert affiliated companies to structured dictionaries
            affiliated_companies: List[Dict[str, Any]] = [
                {
                    "name": affiliated.name,
                    "linkedin_url": affiliated.linkedin_url,
                    "followers": affiliated.followers,
                }
                for affiliated in company.affiliated_companies
            ]
    
            # Build the result dictionary
            result: Dict[str, Any] = {
                "name": company.name,
                "about_us": company.about_us,
                "website": company.website,
                "phone": company.phone,
                "headquarters": company.headquarters,
                "founded": company.founded,
                "industry": company.industry,
                "company_type": company.company_type,
                "company_size": company.company_size,
                "specialties": company.specialties,
                "showcase_pages": showcase_pages,
                "affiliated_companies": affiliated_companies,
                "headcount": company.headcount,
            }
    
            # Add employees if requested and available
            if get_employees and company.employees:
                result["employees"] = company.employees
    
            return result
        except Exception as e:
            return handle_tool_error(e, "get_company_profile")
  • Registers the company tools (including get_company_profile) on the MCP server instance by invoking the register_company_tools function.
    register_company_tools(mcp)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior3/5

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

Description mentions that setting get_employees to true is 'slower', disclosing a behavioral trait. No annotations exist, so the description carries full burden. It does not cover error handling, rate limits, or data freshness, but the core behavior is clear.

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

Conciseness4/5

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

The description is concise and well-structured with a brief summary followed by Args/Returns docstring. It uses only necessary text, though the docstring format adds slight verbosity.

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

Completeness4/5

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

Given the tool's simplicity (2 params, output schema present), the description covers the key aspects: purpose, parameter meanings, return type, and a performance hint. Missing guidance on error cases or prerequisites, but adequate for the complexity.

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 input schema has no descriptions (0% coverage), but the description adds meaningful semantics: company_name is clarified as a LinkedIn company name with examples, and get_employees is explained as controlling employee scraping with a performance note.

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

Purpose5/5

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

The description clearly states 'Get a specific company's LinkedIn profile' with examples like 'docker', 'anthropic', 'microsoft'. It distinguishes from sibling tools like get_person_profile and search_jobs by specifying company focus.

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

Usage Guidelines3/5

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

The description does not provide explicit when-to-use or when-not-to-use guidance relative to siblings, though the purpose is clear. It includes parameter details but lacks contextual triggers or alternative tool references.

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