get_linkedin_profile
Retrieve detailed LinkedIn profile data including work experience, education history, and professional skills by providing a user alias, URL, or URN.
Instructions
Get detailed information about a LinkedIn user profile
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user | Yes | User alias, URL, or URN | |
| with_education | No | Include education info | |
| with_experience | No | Include experience info | |
| with_skills | No | Include skills info |
Implementation Reference
- src/index.ts:231-256 (handler)Handler function that executes the get_linkedin_profile tool: constructs request data, calls the AnySite API endpoint for LinkedIn user profile, returns JSON response or error.async ({ user, with_experience, with_education, with_skills }) => { const requestData = { timeout: 300, user, with_experience, with_education, with_skills }; log("Starting LinkedIn profile lookup for:", user); try { const response = await makeRequest(API_CONFIG.ENDPOINTS.USER_PROFILE, requestData); return { content: [ { type: "text", text: JSON.stringify(response, null, 2) } ] }; } catch (error) { log("LinkedIn profile lookup error:", error); return { content: [ { type: "text", text: `LinkedIn API error: ${formatError(error)}` } ], isError: true }; } }
- src/index.ts:226-230 (schema)Input schema using Zod for validating parameters: user (required string), optional booleans for including experience, education, skills.user: z.string().describe("User alias, URL, or URN"), with_experience: z.boolean().default(true).describe("Include experience info"), with_education: z.boolean().default(true).describe("Include education info"), with_skills: z.boolean().default(true).describe("Include skills info") },
- src/index.ts:223-257 (registration)Registration of the get_linkedin_profile tool on the MCP server using server.tool(), including name, description, input schema, and handler function."get_linkedin_profile", "Get detailed information about a LinkedIn user profile", { user: z.string().describe("User alias, URL, or URN"), with_experience: z.boolean().default(true).describe("Include experience info"), with_education: z.boolean().default(true).describe("Include education info"), with_skills: z.boolean().default(true).describe("Include skills info") }, async ({ user, with_experience, with_education, with_skills }) => { const requestData = { timeout: 300, user, with_experience, with_education, with_skills }; log("Starting LinkedIn profile lookup for:", user); try { const response = await makeRequest(API_CONFIG.ENDPOINTS.USER_PROFILE, requestData); return { content: [ { type: "text", text: JSON.stringify(response, null, 2) } ] }; } catch (error) { log("LinkedIn profile lookup error:", error); return { content: [ { type: "text", text: `LinkedIn API error: ${formatError(error)}` } ], isError: true }; } } );
- src/index.ts:23-23 (helper)API endpoint constant used by the handler: '/api/linkedin/user' for fetching LinkedIn user profiles.USER_PROFILE: "/api/linkedin/user",
- src/types.ts:18-23 (schema)TypeScript interface defining the input arguments for LinkedIn user profile, matching the Zod schema used in the tool.export interface LinkedinUserProfileArgs { user: string; with_experience?: boolean; with_education?: boolean; with_skills?: boolean; }