Skip to main content
Glama

search_jobs

Find job opportunities on LinkedIn by entering specific search terms to match career interests and requirements.

Instructions

Search for jobs on LinkedIn using a search term.

Args: search_term (str): Search term to use for the job search.

Returns: List[Dict[str, Any]]: List of job search results

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
search_termYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The primary handler function for the 'search_jobs' MCP tool. It uses linkedin_scraper.JobSearch to find jobs matching the input search_term, converts Job objects to dictionaries, and handles exceptions with error formatting.
    @mcp.tool()
    async def search_jobs(search_term: str) -> List[Dict[str, Any]]:
        """
        Search for jobs on LinkedIn using a search term.
    
        Args:
            search_term (str): Search term to use for the job search.
    
        Returns:
            List[Dict[str, Any]]: List of job search results
        """
        try:
            driver = safe_get_driver()
    
            logger.info(f"Searching jobs: {search_term}")
            job_search = JobSearch(driver=driver, close_on_complete=False, scrape=False)
            jobs = job_search.search(search_term)
    
            # Convert job objects to dictionaries
            return [job.to_dict() for job in jobs]
        except Exception as e:
            return handle_tool_error_list(e, "search_jobs")
  • Invocation of register_job_tools during MCP server creation, which registers the search_jobs tool (and other job tools) via decorators.
    register_job_tools(mcp)
  • The register_job_tools function defines and registers all job-related tools including search_jobs using @mcp.tool() decorators.
    def register_job_tools(mcp: FastMCP) -> None:
        """
        Register all job-related tools with the MCP server.
    
        Args:
            mcp (FastMCP): The MCP server instance
        """
    
        @mcp.tool()
        async def get_job_details(job_id: str) -> Dict[str, Any]:
            """
            Get job details for a specific job posting on LinkedIn
    
            Args:
                job_id (str): LinkedIn job ID (e.g., "4252026496", "3856789012")
    
            Returns:
                Dict[str, Any]: Structured job data including title, company, location, posting date,
                              application count, and job description (may be empty if content is protected)
            """
            try:
                # Construct clean LinkedIn URL from job ID
                job_url = f"https://www.linkedin.com/jobs/view/{job_id}/"
    
                driver = safe_get_driver()
    
                logger.info(f"Scraping job: {job_url}")
                job = Job(job_url, driver=driver, close_on_complete=False)
    
                # Convert job object to a dictionary
                return job.to_dict()
            except Exception as e:
                return handle_tool_error(e, "get_job_details")
    
        @mcp.tool()
        async def search_jobs(search_term: str) -> List[Dict[str, Any]]:
            """
            Search for jobs on LinkedIn using a search term.
    
            Args:
                search_term (str): Search term to use for the job search.
    
            Returns:
                List[Dict[str, Any]]: List of job search results
            """
            try:
                driver = safe_get_driver()
    
                logger.info(f"Searching jobs: {search_term}")
                job_search = JobSearch(driver=driver, close_on_complete=False, scrape=False)
                jobs = job_search.search(search_term)
    
                # Convert job objects to dictionaries
                return [job.to_dict() for job in jobs]
            except Exception as e:
                return handle_tool_error_list(e, "search_jobs")
    
        @mcp.tool()
        async def get_recommended_jobs() -> List[Dict[str, Any]]:
            """
            Get your personalized recommended jobs from LinkedIn
    
            Returns:
                List[Dict[str, Any]]: List of recommended jobs
            """
            try:
                driver = safe_get_driver()
    
                logger.info("Getting recommended jobs")
                job_search = JobSearch(
                    driver=driver,
                    close_on_complete=False,
                    scrape=True,  # Enable scraping to get recommended jobs
                    scrape_recommended_jobs=True,
                )
    
                if hasattr(job_search, "recommended_jobs") and job_search.recommended_jobs:
                    return [job.to_dict() for job in job_search.recommended_jobs]
                else:
                    return []
            except Exception as e:
                return handle_tool_error_list(e, "get_recommended_jobs")

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.3/5.0
Behavior2/5

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

No annotations are provided, and the description does not disclose behavioral traits such as idempotency, rate limits, authorization requirements, or whether it modifies data. The only behavioral hint is that it is a search (likely read-only), but this is implied rather than explicit.

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 extremely concise: a single sentence followed by a structured Args and Returns section. Every part is necessary and there is no redundant information. It efficiently conveys what the tool does and how to use it.

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 (one parameter, no nested objects) and the presence of an output schema, the description is adequate but lacks details such as pagination, result limits, or query operators. It covers the basics but leaves some behavioral context unspecified.

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 single parameter 'search_term' is described as 'Search term to use for the job search', which adds basic meaning beyond the schema's property name. However, with 0% schema description coverage, the description only restates the obvious without adding constraints, formatting, or examples.

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 the tool's purpose: 'Search for jobs on LinkedIn using a search term.' This provides a specific verb (search) and resource (jobs), and distinguishes it from siblings like 'get_job_details' and 'get_recommended_jobs' which have different functions.

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?

The description offers no guidance on when to use this tool versus alternatives like 'get_recommended_jobs' or 'get_job_details'. There are no conditions, prerequisites, or exclusions mentioned, leaving the agent without contextual decision support.

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