scrape_linkedin
Extract detailed LinkedIn profile data and posts with comments from any profile URL to gather professional insights and content analysis.
Instructions
Retrieves detailed profile data and posts with comments from a LinkedIn profile URL using RapidAPI. Each request costs 2 credits.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| linkedin_url | Yes | The LinkedIn profile URL to scrape. |
Implementation Reference
- src/tools/scrape-linkedin.ts:16-39 (handler)The main handler function that implements the 'scrape_linkedin' tool. It takes a LinkedIn URL, makes a request to the Clado API for scraping, handles errors, and returns the scraped data formatted as tool content.
export const scrapeLinkedinTool = async ({ linkedin_url, }: ScrapeLinkedinParams) => { const apiUrl = new URL("https://search.clado.ai/api/enrich/scrape"); apiUrl.searchParams.append("linkedin_url", linkedin_url); const response = await makeCladoRequest(apiUrl.toString(), {}); const responseData = await response.json(); if (responseData.error) { throw new Error( `Failed to scrape LinkedIn profile: ${JSON.stringify(responseData.error)}` ); } return { content: [ { type: "text" as const, text: `profile scraping completed successfully: ${JSON.stringify(responseData, null, 2)}` } ] }; }; - src/tools/scrape-linkedin.ts:8-10 (schema)The Zod-based input schema defining the 'linkedin_url' parameter for the tool.
export const scrapeLinkedinSchema = { linkedin_url: z.string().describe("The LinkedIn profile URL to scrape."), }; - src/index.ts:45-50 (registration)Registration of the 'scrape_linkedin' tool on the MCP server in the main index file.
server.tool( scrapeLinkedinName, scrapeLinkedinDescription, scrapeLinkedinSchema, scrapeLinkedinTool ); - src/server_setup.ts:31-36 (registration)Registration of the 'scrape_linkedin' tool on the MCP server in the server setup utility.
server.tool( scrapeLinkedinName, scrapeLinkedinDescription, scrapeLinkedinSchema, scrapeLinkedinTool );