Skip to main content
Glama

get_linkedin_profile

Retrieve LinkedIn profile details including headline, summary, experience, and education for user analysis and integration.

Instructions

Retrieve the user's LinkedIn profile information including headline, summary, experience, and education.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • cli.js:777-911 (handler)
    The main handler function for the 'get_linkedin_profile' tool. It authenticates with the API key, calls the backend API to fetch profile data, formats the headline, summary, experience, and education sections into readable text, handles success and error responses, and sends the MCP response.
    } else if (name === 'get_linkedin_profile') { console.error(`${packageName}: Received call for get_linkedin_profile tool.`); const apiKey = process.env.LINKEDIN_MCP_API_KEY; if (!apiKey) { sendResponse({ jsonrpc: "2.0", error: { code: -32001, message: "Server Configuration Error: API Key not set." }, id }); return; } try { const headers = { "Authorization": `Bearer ${apiKey}`, "Content-Type": "application/json", "Accept": "application/json" }; console.error(`${packageName}: Calling LinkedIn profile API: ${backendLinkedinProfileApiUrl}`); const apiResponse = await axios.post(backendLinkedinProfileApiUrl, {}, { headers, timeout: 60000 }); console.error(`${packageName}: LinkedIn profile API response status: ${apiResponse.status}`); console.error(`${packageName}: LinkedIn profile API response data:`, JSON.stringify(apiResponse.data, null, 2)); if (apiResponse.data && apiResponse.data.success) { const profile = apiResponse.data.profile || {}; // Format profile as text to avoid "unsupported content type: data" error let profileHeadline = profile.headline || 'No headline'; let profileSummary = profile.summary || 'No summary'; // Format experience entries let experienceText = 'Experience:'; if (profile.experience && Array.isArray(profile.experience) && profile.experience.length > 0) { profile.experience.forEach((exp, index) => { experienceText += `\n\n${index + 1}. ${exp.title || 'Role'} at ${exp.companyName || 'Company'}`; if (exp.dateRange || exp.duration) { experienceText += `\n Duration: ${exp.dateRange || exp.duration || 'Not specified'}`; } if (exp.description) { experienceText += `\n Description: ${exp.description}`; } }); } else { experienceText += '\n No experience data available'; } // Format education entries let educationText = '\n\nEducation:'; if (profile.education && Array.isArray(profile.education) && profile.education.length > 0) { profile.education.forEach((edu, index) => { educationText += `\n\n${index + 1}. ${edu.schoolName || edu.school || 'Institution'}`; if (edu.degree || edu.fieldOfStudy) { educationText += `\n ${edu.degree || ''} ${edu.fieldOfStudy || ''}`.trim(); } if (edu.dateRange || edu.dates) { educationText += `\n Years: ${edu.dateRange || edu.dates || 'Not specified'}`; } }); } else { educationText += '\n No education data available'; } // Combine all text const profileText = `Headline: ${profileHeadline}\n\nSummary: ${profileSummary}\n\n${experienceText}${educationText}`; sendResponse({ jsonrpc: "2.0", result: { content: [ { type: "text", text: `LinkedIn profile data retrieved. Last updated: ${apiResponse.data.data_last_updated || 'Unknown'}` }, { type: "text", text: profileText } ], isError: false }, id }); } else { const errorMessage = apiResponse.data?.error || "Backend API Error (no detail)"; console.error(`${packageName}: LinkedIn profile API Error: ${errorMessage}`); sendResponse({ jsonrpc: "2.0", result: { content: [ { type: "text", text: `Failed to get LinkedIn profile: ${errorMessage}. This may occur if you haven't set your LinkedIn URL yet. Try using the set_linkedin_url tool first.` } ], isError: true }, id }); } } catch (error) { let errorMessage = `Failed to call LinkedIn profile API: ${error.message}`; if (error.response) { // Extract complete error details from the response const responseData = error.response.data || {}; const extractedError = responseData.error || responseData.message || (typeof responseData === 'string' ? responseData : null); // Include any suggestion provided const suggestion = responseData.suggestion ? `\n\nSuggestion: ${responseData.suggestion}` : ''; // Use the backend's full error message if (extractedError) { errorMessage = `${extractedError}${suggestion}`; } else { // Fallback with a generic message but including the status errorMessage = `Backend API Error (Status ${error.response.status}): Unknown error${suggestion}`; } console.error(`${packageName}: LinkedIn profile API Error Response:`, error.response.data); } else if (error.request) { errorMessage = "No response received from LinkedIn profile API. The server may be unavailable or experiencing issues."; } console.error(`${packageName}: ${errorMessage}`); sendResponse({ jsonrpc: "2.0", result: { content: [ { type: "text", text: `Failed to get LinkedIn profile: ${errorMessage}` } ], isError: true }, id }); }
  • cli.js:1333-1340 (registration)
    Tool registration in the tools/list response, including name, description, and empty inputSchema (no parameters required).
    { name: "get_linkedin_profile", description: "Retrieve the user's LinkedIn profile information including headline, summary, experience, and education.", inputSchema: { type: "object", properties: {} } },
  • Input schema definition for the tool (empty object, no required parameters).
    { name: "get_linkedin_profile", description: "Retrieve the user's LinkedIn profile information including headline, summary, experience, and education.", inputSchema: { type: "object", properties: {} } },
  • cli.js:17-17 (helper)
    Constant defining the backend API endpoint URL used by the get_linkedin_profile handler to fetch profile data.
    const backendLinkedinProfileApiUrl = 'https://ligo.ertiqah.com/api/mcp/linkedin/profile';

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/ertiqah/linkedin-mcp-runner'

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