Skip to main content
Glama

get_linkedin_post_reposts

Retrieve LinkedIn post reposts by providing the post URN to track content sharing and engagement metrics across the platform.

Instructions

Get LinkedIn reposts for a post by URN

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countYesMax reposts to return
timeoutNoTimeout in seconds
urnYesPost URN, only activity urn type is allowed (example: activity:7234173400267538433)

Implementation Reference

  • Registration and inline handler for the 'get_linkedin_post_reposts' tool. Defines schema with Zod, executes API request to retrieve reposts for a given post URN, handles errors, and formats response as text content.
      "get_linkedin_post_reposts",
      "Get LinkedIn post reposts",
      {
        urn: z.string().describe("Post URN"),
        count: z.number().default(10).describe("Max reposts"),
        timeout: z.number().default(300).describe("Timeout in seconds")
      },
      async ({ urn, count, timeout }) => {
        const requestData = { timeout, urn, count };
        log(`Starting LinkedIn post reposts lookup for: ${urn}`);
        try {
          const response = await makeRequest(API_CONFIG.ENDPOINTS.LINKEDIN_POST_REPOSTS, requestData);
          return {
            content: [{ type: "text", text: JSON.stringify(response, null, 2) }]
          };
        } catch (error) {
          log("LinkedIn post reposts lookup error:", error);
          return {
            content: [{ type: "text", text: `LinkedIn post reposts API error: ${formatError(error)}` }],
            isError: true
          };
        }
      }
    );
  • TypeScript interface defining input parameters for get_linkedin_post_reposts tool.
    export interface GetLinkedinPostRepostsArgs {
      urn: string;
      count?: number;
      timeout?: number;
    }
  • Runtime type guard/validator for GetLinkedinPostRepostsArgs input.
    export function isValidGetLinkedinPostRepostsArgs(
      args: unknown
    ): args is GetLinkedinPostRepostsArgs {
      if (typeof args !== "object" || args === null) return false;
      const obj = args as Record<string, unknown>;
      if (typeof obj.urn !== "string" || !obj.urn.includes("activity:")) return false;
      if (obj.count !== undefined && typeof obj.count !== "number") return false;
      if (obj.timeout !== undefined && typeof obj.timeout !== "number") return false;
      return true;
    }
  • API endpoint path used by the get_linkedin_post_reposts handler.
    LINKEDIN_POST_REPOSTS: "/api/linkedin/post/reposts",
  • Shared HTTP request utility function used by all tools including get_linkedin_post_reposts to make authenticated POST requests to the AnySite API.
    const makeRequest = (endpoint: string, data: any, method: string = "POST"): Promise<any> => {
      return new Promise((resolve, reject) => {
        const url = new URL(endpoint, API_CONFIG.BASE_URL);
        const postData = JSON.stringify(data);
    
        const options = {
          hostname: url.hostname,
          port: url.port || 443,
          path: url.pathname,
          method: method,
          headers: {
            "Content-Type": "application/json",
            "Content-Length": Buffer.byteLength(postData),
            "access-token": API_KEY,
            ...(ACCOUNT_ID && { "x-account-id": ACCOUNT_ID })
          }
        };
    
        const req = https.request(options, (res) => {
          let responseData = "";
          res.on("data", (chunk) => {
            responseData += chunk;
          });
    
          res.on("end", () => {
            try {
              const parsed = JSON.parse(responseData);
              if (res.statusCode && res.statusCode >= 200 && res.statusCode < 300) {
                resolve(parsed);
              } else {
                reject(new Error(`API error ${res.statusCode}: ${JSON.stringify(parsed)}`));
              }
            } catch (e) {
              reject(new Error(`Failed to parse response: ${responseData}`));
            }
          });
        });
    
        req.on("error", (error) => {
          reject(error);
        });
    
        req.write(postData);
        req.end();
      });
    };
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions retrieving reposts but does not cover critical aspects like rate limits, authentication requirements, error handling, or the format of returned data. This leaves significant gaps in understanding how the tool behaves in practice.

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, direct sentence that efficiently conveys the core purpose without unnecessary words. It is front-loaded and wastes no space, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It does not address behavioral traits, return values, or usage context, which are essential for a tool that interacts with an external API like LinkedIn. This leaves the agent with insufficient information to use the tool effectively beyond basic parameter passing.

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

Parameters3/5

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

Schema description coverage is 100%, meaning all parameters are documented in the input schema. The description adds no additional semantic context beyond implying the 'urn' parameter specifies the post. Since the schema handles parameter details adequately, the baseline score of 3 is appropriate, as the description does not compensate or add value beyond the schema.

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 action ('Get LinkedIn reposts') and the target resource ('for a post by URN'), making the purpose understandable. However, it does not explicitly differentiate from sibling tools like 'get_linkedin_post_reactions' or 'get_linkedin_post_comments', which also retrieve post-related data but for different aspects.

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, such as other LinkedIn post-related tools (e.g., for reactions or comments). It lacks context about prerequisites, limitations, or scenarios where this tool is preferred, leaving usage decisions ambiguous.

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/anysiteio/hdw-mcp-server'

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