Skip to main content
Glama

get_person_profile

Retrieve structured LinkedIn profile data by entering a username to access professional information and connections.

Instructions

Get a specific person's LinkedIn profile.

Args: linkedin_username (str): LinkedIn username (e.g., "stickerdaniel", "anistji")

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
linkedin_usernameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'get_person_profile' tool. It constructs the LinkedIn URL, scrapes the profile using linkedin_scraper.Person, structures experiences, educations, interests, accomplishments, and contacts into dictionaries, and returns the profile data or handles errors.
    @mcp.tool()
    async def get_person_profile(linkedin_username: str) -> Dict[str, Any]:
        """
        Get a specific person's LinkedIn profile.
    
        Args:
            linkedin_username (str): LinkedIn username (e.g., "stickerdaniel", "anistji")
    
        Returns:
            Dict[str, Any]: Structured data from the person's profile
        """
        try:
            # Construct clean LinkedIn URL from username
            linkedin_url = f"https://www.linkedin.com/in/{linkedin_username}/"
    
            driver = safe_get_driver()
    
            logger.info(f"Scraping profile: {linkedin_url}")
            person = Person(linkedin_url, driver=driver, close_on_complete=False)
    
            # Convert experiences to structured dictionaries
            experiences: List[Dict[str, Any]] = [
                {
                    "position_title": exp.position_title,
                    "company": exp.institution_name,
                    "from_date": exp.from_date,
                    "to_date": exp.to_date,
                    "duration": exp.duration,
                    "location": exp.location,
                    "description": exp.description,
                }
                for exp in person.experiences
            ]
    
            # Convert educations to structured dictionaries
            educations: List[Dict[str, Any]] = [
                {
                    "institution": edu.institution_name,
                    "degree": edu.degree,
                    "from_date": edu.from_date,
                    "to_date": edu.to_date,
                    "description": edu.description,
                }
                for edu in person.educations
            ]
    
            # Convert interests to list of titles
            interests: List[str] = [interest.title for interest in person.interests]
    
            # Convert accomplishments to structured dictionaries
            accomplishments: List[Dict[str, str]] = [
                {"category": acc.category, "title": acc.title}
                for acc in person.accomplishments
            ]
    
            # Convert contacts to structured dictionaries
            contacts: List[Dict[str, str]] = [
                {
                    "name": contact.name,
                    "occupation": contact.occupation,
                    "url": contact.url,
                }
                for contact in person.contacts
            ]
    
            # Return the complete profile data
            return {
                "name": person.name,
                "about": person.about,
                "experiences": experiences,
                "educations": educations,
                "interests": interests,
                "accomplishments": accomplishments,
                "contacts": contacts,
                "company": person.company,
                "job_title": person.job_title,
                "open_to_work": getattr(person, "open_to_work", False),
            }
        except Exception as e:
            return handle_tool_error(e, "get_person_profile")
  • The registration function that defines and registers the get_person_profile tool using the @mcp.tool() decorator inside it.
    def register_person_tools(mcp: FastMCP) -> None:
        """
        Register all person-related tools with the MCP server.
    
        Args:
            mcp (FastMCP): The MCP server instance
        """
  • Top-level MCP server creation where register_person_tools is called to register the get_person_profile tool among others.
    def create_mcp_server() -> FastMCP:
        """Create and configure the MCP server with all LinkedIn tools."""
        mcp = FastMCP("linkedin_scraper")
    
        # Register all tools
        register_person_tools(mcp)
        register_company_tools(mcp)
        register_job_tools(mcp)
  • Import of the register_person_tools function used to register the tool.
    from linkedin_mcp_server.tools.person import register_person_tools

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?

Basic read operation described, but lacks disclosure of rate limits, authentication requirements, or error handling. Without annotations, description carries the burden but provides minimal behavioral context.

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?

Extremely concise with front-loaded purpose, clear Args/Returns sections, and no unnecessary words.

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

Completeness5/5

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

For a simple one-parameter tool with an output schema, the description fully explains the parameter and return type, making it complete.

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?

Description adds example and clarifies the parameter format (LinkedIn username), which adds meaning beyond the schema's simple 'string' type.

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?

Clearly states it retrieves a specific person's LinkedIn profile. Differentiates from siblings which deal with companies, jobs, sessions, or searches.

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 on when to use this tool versus alternatives. No mention of context or prerequisites.

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