Skip to main content
Glama

get_job_details

Retrieve structured job posting information from LinkedIn using a job ID, including title, company, location, and description.

Instructions

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)

Input Schema

NameRequiredDescriptionDefault
job_idYes

Input Schema (JSON Schema)

{ "properties": { "job_id": { "title": "Job Id", "type": "string" } }, "required": [ "job_id" ], "type": "object" }

Implementation Reference

  • The primary handler implementation for the get_job_details tool. It constructs a LinkedIn job URL from the job_id, scrapes the job details using linkedin_scraper.Job, converts to dict, and handles errors.
    @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")
  • Imports the register_job_tools function and calls it on the MCP instance during server creation, which registers the get_job_details tool among others.
    from linkedin_mcp_server.tools.company import register_company_tools from linkedin_mcp_server.tools.job import register_job_tools from linkedin_mcp_server.tools.person import register_person_tools logger = logging.getLogger(__name__) 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)

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/Kappasig920/MCP-LinkedIn'

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