Skip to main content
Glama
ertiqah
by ertiqah

refresh_linkedin_profile

Update LinkedIn profile data to reflect recent changes and ensure information is current.

Instructions

Force a refresh of the LinkedIn profile data to update any recent changes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler for 'refresh_linkedin_profile'. Checks API key, calls backend API to refresh profile data, handles response and errors, sends JSON-RPC result.
    } else if (name === 'refresh_linkedin_profile') {
        console.error(`${packageName}: Received call for refresh_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 refresh LinkedIn profile API: ${backendLinkedinRefreshProfileApiUrl}`);
            const apiResponse = await axios.post(backendLinkedinRefreshProfileApiUrl, {}, { headers, timeout: 60000 });
            console.error(`${packageName}: Refresh LinkedIn profile API response status: ${apiResponse.status}`);
            console.error(`${packageName}: Refresh LinkedIn profile API response data:`, JSON.stringify(apiResponse.data, null, 2));
    
            if (apiResponse.data && apiResponse.data.success) {
                sendResponse({ 
                  jsonrpc: "2.0", 
                  result: { 
                    content: [
                      {
                        type: "text",
                        text: apiResponse.data.message || "Successfully refreshed LinkedIn profile data."
                      }
                    ],
                    isError: false
                  }, 
                  id 
                });
            } else {
                const errorMessage = apiResponse.data?.error || "Backend API Error (no detail)";
                console.error(`${packageName}: Refresh LinkedIn profile API Error: ${errorMessage}`);
                sendResponse({ 
                  jsonrpc: "2.0", 
                  result: {
                    content: [
                      {
                        type: "text",
                        text: `Failed to refresh LinkedIn profile: ${errorMessage}`
                      }
                    ],
                    isError: true
                  }, 
                  id 
                });
            }
    
        } catch (error) {
            let errorMessage = `Failed to call refresh 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);
                
                // Use the backend's full error message
                if (extractedError) {
                    errorMessage = extractedError;
                } else {
                    // Fallback with a generic message but including the status
                    errorMessage = `Backend API Error (Status ${error.response.status}): Unknown error`;
                }
                
                console.error(`${packageName}: Refresh LinkedIn profile API Error Response:`, error.response.data); 
            } else if (error.request) {
                errorMessage = "No response received from refresh LinkedIn profile API.";
            }
            console.error(`${packageName}: ${errorMessage}`);
            
            sendResponse({ 
              jsonrpc: "2.0", 
              result: { 
                content: [
                  {
                    type: "text",
                    text: `Failed to refresh LinkedIn profile: ${errorMessage}`
                  }
                ],
                isError: true
              }, 
              id 
            });
        }
  • cli.js:1356-1362 (registration)
    Registration of the 'refresh_linkedin_profile' tool in the MCP 'tools/list' response, defining name, description, and empty input schema (no parameters required).
        name: "refresh_linkedin_profile",
        description: "Force a refresh of the LinkedIn profile data to update any recent changes.",
        inputSchema: {
            type: "object",
            properties: {}
        }
    },
  • cli.js:19-19 (helper)
    Constant defining the backend API endpoint URL used by the refresh_linkedin_profile handler.
    const backendLinkedinRefreshProfileApiUrl = 'https://ligo.ertiqah.com/api/mcp/linkedin/refresh-profile';
  • Input schema for refresh_linkedin_profile tool: empty object (no input parameters required).
        type: "object",
        properties: {}
    }

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