Skip to main content
Glama
ertiqah
by ertiqah

refresh_linkedin_posts

Force refresh LinkedIn posts data to fetch the most recent published content from your network.

Instructions

Force a refresh of LinkedIn posts data to capture recently published content.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler for the 'refresh_linkedin_posts' tool. It validates the API key, calls the backend endpoint (backendLinkedinRefreshPostsApiUrl) via axios POST, and returns success or error responses.
    } else if (name === 'refresh_linkedin_posts') {
        console.error(`${packageName}: Received call for refresh_linkedin_posts 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 posts API: ${backendLinkedinRefreshPostsApiUrl}`);
            const apiResponse = await axios.post(backendLinkedinRefreshPostsApiUrl, {}, { headers, timeout: 60000 });
            console.error(`${packageName}: Refresh LinkedIn posts API response status: ${apiResponse.status}`);
            console.error(`${packageName}: Refresh LinkedIn posts 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 posts data."
                      }
                    ],
                    isError: false
                  }, 
                  id 
                });
            } else {
                const errorMessage = apiResponse.data?.error || "Backend API Error (no detail)";
                console.error(`${packageName}: Refresh LinkedIn posts API Error: ${errorMessage}`);
                sendResponse({ 
                  jsonrpc: "2.0", 
                  result: {
                    content: [
                      {
                        type: "text",
                        text: `Failed to refresh LinkedIn posts: ${errorMessage}`
                      }
                    ],
                    isError: true
                  }, 
                  id 
                });
            }
    
        } catch (error) {
            let errorMessage = `Failed to call refresh LinkedIn posts 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 posts API Error Response:`, error.response.data); 
            } else if (error.request) {
                errorMessage = "No response received from refresh LinkedIn posts API.";
            }
            console.error(`${packageName}: ${errorMessage}`);
            
            sendResponse({ 
              jsonrpc: "2.0", 
              result: { 
                content: [
                  {
                    type: "text",
                    text: `Failed to refresh LinkedIn posts: ${errorMessage}`
                  }
                ],
                isError: true
              }, 
              id 
            });
        }
  • cli.js:1382-1389 (registration)
    Registration of the 'refresh_linkedin_posts' tool in the tools/list response, defining its name, description, and inputSchema (empty object).
    {
        name: "refresh_linkedin_posts",
        description: "Force a refresh of LinkedIn posts data to capture recently published content.",
        inputSchema: {
            type: "object",
            properties: {}
        }
    }
  • cli.js:20-20 (helper)
    The backend URL constant for refreshing LinkedIn posts, used by the handler to make the API call.
    const backendLinkedinRefreshPostsApiUrl = 'https://ligosocial.com/api/mcp/linkedin/refresh-posts';
Behavior2/5

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

No annotations are provided, so the description must fully disclose behavior. It states 'Force a refresh' but does not explain side effects (e.g., whether existing data is overwritten, if the operation is synchronous or asynchronous, or any rate limits). The description is too minimal for a mutating action.

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 clear sentence that is front-loaded with the verb and resource. Every word contributes meaning, no fluff.

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?

The tool is simple (no parameters, no output schema), but the description lacks completeness regarding follow-up actions. For example, it does not mention that results can be retrieved via get_linkedin_posts. Adequate but not fully contextualized.

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 input schema has zero parameters and 100% coverage (no fields to document). The description adds meaning by explaining the purpose of the tool (refresh) beyond the empty schema. Given no parameters, a baseline of 4 is appropriate.

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

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Force a refresh') and the resource ('LinkedIn posts data') with a specific goal ('to capture recently published content'). It distinguishes from siblings like get_linkedin_posts (which retrieves) and publish_linkedin_post (which creates).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when needing to capture recent content, but does not provide explicit guidance on when to use this tool versus alternatives like get_linkedin_posts (which might already fetch recent data) or schedule_linkedin_post. No exclusions or prerequisites are mentioned.

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