Skip to main content
Glama
ertiqah
by ertiqah

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';
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states what data is retrieved but doesn't describe how: whether it requires authentication, returns real-time or cached data, has rate limits, or what happens on errors. For a data retrieval tool with zero annotation coverage, this leaves significant behavioral gaps unexplained.

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 a single, efficient sentence that front-loads the core action ('Retrieve') and immediately specifies the resource and key data fields. Every word contributes meaning without redundancy or unnecessary elaboration. It's appropriately sized for a simple retrieval tool.

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 (0 parameters, no output schema, no annotations), the description adequately covers the basic purpose and data scope. However, it lacks behavioral context that would be helpful for an agent (like authentication requirements or data freshness). Without annotations or output schema, the description should ideally provide more operational guidance to be fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so the schema already fully documents the absence of parameters. The description appropriately doesn't discuss parameters since none exist, maintaining focus on the tool's purpose. This meets the baseline expectation for parameterless tools.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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: 'Retrieve the user's LinkedIn profile information' with specific data fields (headline, summary, experience, education). It distinguishes from siblings like 'get_linkedin_posts' (posts vs profile) and 'refresh_linkedin_profile' (retrieve vs refresh), but doesn't explicitly contrast them. The verb 'retrieve' is specific and the resource 'LinkedIn profile' is well-defined.

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 provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose 'get_linkedin_profile' over 'refresh_linkedin_profile' (which might update cached data) or 'analyze_linkedin_chat' (which might analyze conversations). There's no context about prerequisites, timing, or exclusions for usage.

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

Install Server

Other Tools

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